<template>
  <div class="search-component">
    <el-row class="number-of-cards">
      <div class="row">
        <p class="label">剩餘可辦月卡數量:&nbsp;</p>
        <span>123</span>
        <p>&nbsp;張</p>
      </div>
      <div class="row">
        <p class="label">可辦月卡數量:&nbsp;</p>
        <span>123</span>
        <p>&nbsp;張</p>
      </div>
    </el-row>
    <el-row>
      <p class="label">商戶卡狀態</p>
      <template v-for="item in status" :key="item.value">
        <el-button
          :class="
            cardStatus == item.value ? 'truestatusno-name' : 'truestatus-name'
          "
          :link="cardStatus == item.value ? false : true"
          @click="changeStatus(item.value)"
          >{{ item.name }}</el-button
        >
      </template>
    </el-row>
  </div>
</template>

<script setup>
import { ref } from "vue";
const status = [
  {
    name: "全部",
    value: "",
  },
  {
    name: "正常",
    value: 1,
  },
  {
    name: "未開始",
    value: 2,
  },
  {
    name: "已過期",
    value: 3,
  },
  {
    name: "已註銷",
    value: 4,
  },
  {
    name: "已封存",
    value: 5,
  },
];
const cardStatus = ref("");
const changeStatus = (value) => {
  cardStatus.value = value;
};
</script>

<style lang="less">
.search-component {
  .number-of-cards {
    & > :nth-child(1) {
      margin-right: 110px;
    }
  }
  .row {
    display: flex;
    align-items: center;
  }
  .label {
    font-size: 16px;
    color: #333333;
    margin-right: 10px;
    font-weight: 600;
  }
  .status-name {
    padding: 4px 16px;
    border-radius: 4px;
    font-size: 14px;
    color: #333333;
    font-weight: 400;
  }
  .truestatusno-name {
    padding: 4px 16px;
    background: #de2910;
    border-radius: 4px;
    font-size: 14px;
    color: #ffffff;
    font-weight: 400;
  }
}
</style>